import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/layout/index.vue'
import ModelList from '@/views/model/list/index.vue'
import ModelState from '@/views/model/state/index.vue'
import ModelListSider from '@/views/model/components/sidebar.vue'
import PageChat from '@/views/chat/index.vue'
import PageDocs from '@/views/docs/index.vue'
import HistorySession from '@/views/chat/components/history-session.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: Layout,
      redirect: '/model/list',
      children: [
        {
          path: '/model/list',
          name: 'model-list',
          components: {
            default: ModelList,
            sidebar: ModelListSider,
          },
        },
        {
          path: '/model/state',
          name: 'model-state',
          components: {
            default: ModelState,
            sidebar: ModelListSider,
          },
        },
        {
          path: '/chat',
          name: 'chat',
          components: {
            sidebar: HistorySession,
            default: PageChat,
          },
        },
        {
          path: '/docs',
          name: 'docs',
          component: PageDocs,
        },
      ],
    },
  ],
})

export default router
